package com.bdqn.role;

public class Greeting {
    // 说话的人
    private String person = "Nobody";
    // 说话的内容
    private String words = "nothing";

    /**
     * 无参构造
     */
    public Greeting() {
    }

    /**
     * 注入person和words
     */
    public Greeting(String person, String words) {
        this.person = person;
        this.words = words;
    }

    /**
     * 定义说话方法。
     */
    public void sayGreeting() {
        System.out.println(person + "说：“" + words + "”");
    }

    public void setPerson(String person) {
        this.person = person;
    }

    public void setWords(String words) {
        this.words = words;
    }
}
